package com.bjtu.douyin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bjtu.common.pojo.Comment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CommentMapper extends BaseMapper<Comment> {
    @Select("SELECT * FROM comment WHERE video_id = #{videoId} AND status != 2")
    List<Comment> selectComments(@Param("videoId") Integer videoId);

    @Select("SELECT * FROM comment WHERE root_comment_id = #{rootCommentId};")
    List<Comment> selectByRootCommentId(Integer rootCommentId);

    @Select("SELECT * FROM comment WHERE to_comment_id = #{toCommentId};")
    List<Comment> selectByToCommentId(Integer toCommentId);

}
